package com.gitee.wsl.ext.array

fun FloatArray.mix(other: FloatArray, transform: (a: Float, b: Float) -> Float) {
    val size = minOf(size, other.size)
    for (i in 0 until size) {
        this[i]=(transform(this[i], other[i]))
    }
}

fun DoubleArray.mix(other: DoubleArray, transform: (a: Double, b: Double) -> Double) {
    val size = minOf(size, other.size)
    for (i in 0 until size) {
        this[i]=(transform(this[i], other[i]))
    }
}

fun IntArray.mix(other: IntArray, transform: (a: Int, b: Int) -> Int) {
    val size = minOf(size, other.size)
    for (i in 0 until size) {
        this[i]=(transform(this[i], other[i]))
    }
}